<div class="form_container">
    <h1>Edit Grading Categories</h1>

    {% if GCForms %}
    <form action='.' method='post'>{% csrf_token %}
	<button type="submit" class="button SaveButton" name="Save" value="SaveEdit" style="position: fixed; bottom: 0px; right: 0px; z-index: 5;" title="Save and Continue Editing">Save</button>

	{% for form in GCForms %}
	{% for field in form.hidden_fields %}{{field}}{% endfor %}
	<div class="sub_form">
	    <div class="title">
		{{form.instance.name}}
	    </div>
	    <div class="content">
		<table cellpadding="0" cellspacing="2">
		    <tr><th><a name="section{{form.instance.number}}">Category</a></th><th>{{form.number}}</th></tr>
		<tr>
		    <td>{{form.weight.label_tag}}</td><td>{{form.weight}}<br>{{form.weight.help_text}}</td><td>{{form.weight.errors}}</td>
		</tr>
		<tr>
		    <td>{{form.grading.label_tag}}</td><td>{{form.grading}}<br>{{form.grading.help_text}}</td><td>{{form.grading.errors}}</td>
		</tr>
		<tr>
		    <td>{{form.option.label_tag}}</td><td>{{form.option}}<br>{{form.option.help_text}}</td><td>{{form.option.errors}}</td>
		</tr>
		<tr>
		    <td>{{form.option_argument.label_tag}}</td><td>{{form.option_argument}}<br>{{form.option_argument.help_text}}</td><td>{{form.option_argument.errors}}</td>
		</tr>
		</table>
	    </div>
	</div>
	{% endfor %}
	<table>
	<tr>
	    <td colspan="4" class="Buttons">
		<button type="submit" class="button SaveButton floatleft" name="Save" value="SaveEdit" title="Save and Continue Editing">Save and Continue</button>
		<button type="submit" class="button SaveButton floatleft" name="Save" value="SaveReturn" title="Save and Return to Gradebook">Save and Return</button>
		<a class="button SaveButton" href="{% course_url management app='grades' %}">Cancel</a>
	    </td>
	</tr>
	</table>
    </form>
    {% else %}
    <p>No grading categories exist yet. Grading categories are created when you specify the category of assignments and then visit the gradebook</p>
    {% endif %}

</div>
